<!-- 主要内容 -->
<div class="main works">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        {include file="common/tab_nav"}
        <div class="layui-tab-content"></div>
    </div>
    <div class="item">
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                {volist name="data.data" id="item" empty="$empty" }
                <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                    <div class="img-text">

                            {empty name="$item.pic"}
                            <img width="240" height="170" src="__INDEX__/img/default.jpg" alt="暂时没有缩略图">
                            {else /}
                            <img style="cursor:pointer;" onclick="getPhoto({$item.id})" width="285" height="209" src="{$item.pic}" alt="{$item.title}">
                            {/empty}
                        {empty name="$item.works_url"}
                        <a href="javascript:;">
                        {else /}
                            <a target="_blank" href="{$item.works_url}">
                        {/empty}
                            <p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">{$item.title}</font></font></p>
                        </a>
                    </div>
                </div>
                {/volist}
            </div>
        </div>

        <!--分页-->
        {php}
        $pageMethod = '/works';
        {/php}
        {include file="common/page"}
    </div>
    <script>
        function getPhoto(id){
            $.getJSON("{:url('getPhoto')}",{id:id}, function(json){
                layer.photos({
                    photos: json
                    ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
                });
            });
        }
    </script>
</div>
